<?php
class Cornholio_Form_Decorator_Image extends Zend_Form_Decorator_ViewHelper {
    public function render($content)
    {
        $element = $this->getElement();

        $view = $element->getView();

        $helper        = $this->getHelper();
        $value         = $this->getValue($element);
        $attribs       = $this->getElementAttribs();
        $name          = $element->getFullyQualifiedName();
        $attribs['id'] = $element->getId();

        $elementContent = $view->$helper($name, $value, $attribs, $element->options);

        if ($element->getAttrib('src')) {
        	$elementContent
        		.= '<br><img src = "' . $element->getAttrib('src') . '" />'
        		.  '<label for = "' . $element->getName() . '_clean" class="form_label optional">'
        		.  '<input class = "checkbox" type = checkbox name = "' . $element->getName() . '_clean" '
        		.  'id = "' .  $element->getName(). '_clean">'
        		.  ' Удалить'
        		.  '</label>';
		}

		return $elementContent;
    }
}